package com.buanalintas.sandals.pos.entities;

import com.buanalintas.bynga.entities.MasterUnit;
import com.buanalintas.bynga.entities.MasterUser;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.Lob;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;

@Entity
@Table(name = "pos_transaction_retur_shop")
@XmlRootElement
//@NamedQueries({
//    @NamedQuery(name = "PosTransactionReturShot.findAll", query = "SELECT t FROM PosTransactionReturShop t"),
//    @NamedQuery(name = "PosTransactionReturShot.findBySync", query = "SELECT t FROM PosTransactionReturShop t WHERE t.sync = :sync"),
//    @NamedQuery(name = "PosTransactionReturShot.findByReturShopId", query = "SELECT t FROM PosTransactionReturShop t WHERE t.returShopId = :returShopId"),
//    @NamedQuery(name = "PosTransactionReturShot.findByReturShopNumber", query = "SELECT t FROM PosTransactionReturShop t WHERE t.returShopNumber = :returShopNumber"),
//    @NamedQuery(name = "PosTransactionReturShot.findByReturShopDate", query = "SELECT t FROM PosTransactionReturShop t WHERE t.returShopDate = :returShopDate"),
//    @NamedQuery(name = "PosTransactionReturShot.findByReturShopTimestamt", query = "SELECT t FROM PosTransactionReturShop t WHERE t.returShopTimestamp = :returShopTimestamt")})
public class PosTransactionReturShop implements Serializable {

    private static final long serialVersionUID = 1L;
    @Column(name = "sync")
    private String sync;
    @Id
    @Basic(optional = false)
    @Column(name = "retur_shop_id")
    private Integer returShopId;
    @Basic(optional = false)
    @Column(name = "retur_shop_number")
    private String returShopNumber;
    @Basic(optional = false)
    @Column(name = "retur_shop_progress")
    private String returShopProgress;
    @Basic(optional = false)
    @Column(name = "retur_shop_reject_reason")
    private String returShopRejectReason;
    @Basic(optional = false)
    @Column(name = "retur_shop_date")
    @Temporal(TemporalType.DATE)
    private Date returShopDate;
    @Basic(optional = false)
    @Lob
    @Column(name = "retur_shop_description")
    private String returShopDescription;
    @Basic(optional = false)
    @Column(name = "retur_shop_timestamp")
    @Temporal(TemporalType.TIMESTAMP)
    private Date returShopTimestamp;
    @JoinColumn(name = "retur_shop_user_id", referencedColumnName = "user_id")
    @ManyToOne(optional = false)
    private MasterUser returShopUserId;
    @JoinColumn(name = "retur_shop_unit_id", referencedColumnName = "unit_id")
    @ManyToOne(optional = false)
    private MasterUnit returShopUnitId;
//    @JoinColumn(name = "retur_shop_shop_id", referencedColumnName = "shop_id")
//    @ManyToOne(optional = false)
//    private PosMasterShop returShopShopId;

    public PosTransactionReturShop() {
    }

    public PosTransactionReturShop(Integer returShopId) {
        this.returShopId = returShopId;
    }

    public PosTransactionReturShop(Integer returShopId, String returShopNumber, Date returShopDate, String returShopDescription, Date returShopTimestamp) {
        this.returShopId = returShopId;
        this.returShopNumber = returShopNumber;
        this.returShopDate = returShopDate;
        this.returShopDescription = returShopDescription;
        this.returShopTimestamp = returShopTimestamp;
    }

    public String getSync() {
        return sync;
    }

    public void setSync(String sync) {
        this.sync = sync;
    }

    public Integer getReturShopId() {
        return returShopId;
    }

    public void setReturShopId(Integer returShopId) {
        this.returShopId = returShopId;
    }

    public String getReturShopNumber() {
        return returShopNumber;
    }

    public void setReturShopNumber(String returShopNumber) {
        this.returShopNumber = returShopNumber;
    }

    public String getReturShopProgress() {
        return returShopProgress;
    }

    public void setReturShopProgress(String returShopProgress) {
        this.returShopProgress = returShopProgress;
    }

    public String getReturShopRejectReason() {
        return returShopRejectReason;
    }

    public void setReturShopRejectReason(String returShopRejectReason) {
        this.returShopRejectReason = returShopRejectReason;
    }

    public MasterUnit getReturShopUnitId() {
        return returShopUnitId;
    }

    public void setReturShopUnitId(MasterUnit returShopUnitId) {
        this.returShopUnitId = returShopUnitId;
    }

    public MasterUser getReturShopUserId() {
        return returShopUserId;
    }

    public void setReturShopUserId(MasterUser returShopUserId) {
        this.returShopUserId = returShopUserId;
    }

    public Date getReturShopDate() {
        return returShopDate;
    }

    public void setReturShopDate(Date returShopDate) {
        this.returShopDate = returShopDate;
    }

    public String getReturShopDescription() {
        return returShopDescription;
    }

    public void setReturShopDescription(String returShopDescription) {
        this.returShopDescription = returShopDescription;
    }

    public Date getReturShopTimestamp() {
        return returShopTimestamp;
    }

    public void setReturShopTimestamp(Date returShopTimestamp) {
        this.returShopTimestamp = returShopTimestamp;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (returShopId != null ? returShopId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof PosTransactionReturShop)) {
            return false;
        }
        PosTransactionReturShop other = (PosTransactionReturShop) object;
        if ((this.returShopId == null && other.returShopId != null) || (this.returShopId != null && !this.returShopId.equals(other.returShopId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.buanalintas.sandals.pos.entities.PosTransactionReturShop[ returShopId=" + returShopId + " ]";
    }
}
